package sis.studentinfo;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;



public class StudentTest {
	
	private Student student;
	
	@Before
	public void setUp()  {
		student = new Student("a");
	}

	@Test
	public void testCreate() {
		final String firstStudentName = "Jane Doe";
		Student student = new Student(firstStudentName);
		assertEquals(firstStudentName, student.getName());
		
		Student secondStudent = new Student("Jone Blow");
		assertEquals("Jone Blow", secondStudent.getName());
		
		assertEquals(firstStudentName, student.getName());
	}
	
	@Test
	public void testStudentStatus() {
		assertEquals(0, student.getCredits());
		assertFalse("not enough credits for FT status", student.isFullTime());

		student.addCreadits(3);
		assertEquals(3, student.getCredits());
		assertFalse(student.isFullTime());
	
		student.addCreadits(4);
		assertEquals(7, student.getCredits());
		assertFalse(student.isFullTime());
		
		student.addCreadits(5);
		assertEquals(12, student.getCredits());
		assertTrue(student.isFullTime());
		
		assertEquals(Student.CREDITS_REQUIRED_FOR_FULL_TIME,
				student.getCredits());
	}
	
	@Test
	public void TestInState() {
		assertFalse(student.inInState());
		student.setState(Student.IN_STATE);
		assertTrue(student.inInState());
		student.setState("MD");
		assertFalse(student.inInState());
		
	}
}
